<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <input type="text" value="2245788656">
    <input type="text" value="2245788656">
    <input type="button" value="提交">
    <script src="../lb/axios.min.js"></script>
    <script src="../config/config.js"></script>
    <script>
    let ipt=document.querySelectorAll("input");
    ipt[2].onclick=function(){
        axios.get(loginApi,{
            params:{
                username:ipt[0].value,
                password:ipt[1].value
            }
        }).then(res=>{
            console.log(res)
            if(res.data.code==1){
                alert(res.data.msg)
                localStorage.setItem("token",res.data.data.id);
                localStorage.setItem("username",res.data.data.username);
                location.href="index.html"
            }else{
                alert(res.data.msg)
            }
        }).catch(error=>{
            alert(error)
        })
    }
    
    
    
    
    </script>
</body>
</html>